package com.example.hxds.bff.driver.feign;

import com.example.hxds.bff.driver.config.MultipartSupportConfig;
import com.example.hxds.bff.driver.controller.form.CalculateOrderMileageForm;
import com.example.hxds.bff.driver.controller.form.InsertOrderGpsForm;
import com.example.hxds.bff.driver.controller.form.InsertOrderMonitoringForm;
import com.example.hxds.common.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;


/**
 * 代理大数据子系统
 */
@FeignClient(value = "hxds-nebula", configuration = MultipartSupportConfig.class)
public interface NebulaServiceApi {


    /**
     * 上传行驶记录
     *
     * @param file
     * @param name
     * @param text
     * @return
     */
    @PostMapping(value = "/monitoring/uploadRecordFile", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    R uploadRecordFile(@RequestPart(value = "file") MultipartFile file,
                       @RequestPart("name") String name,
                       @RequestPart(value = "text", required = false) String text);


    /**
     * 插入行驶记录
     *
     * @param form
     * @return
     */
    @PostMapping(value = "/monitoring/insertOrderMonitoring")
    R insertOrderMonitoring(InsertOrderMonitoringForm form);


    /**
     * 插入行驶轨迹
     *
     * @param form
     * @return
     */
    @PostMapping("/order/gps/insertOrderGps")
    R insertOrderGps(InsertOrderGpsForm form);


    /**
     * 订单里程
     *
     * @param form
     * @return
     */
    @PostMapping("/order/gps/calculateOrderMileage")
    R calculateOrderMileage(CalculateOrderMileageForm form);
}
